home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / AppleGuide.h < prev    next >
Text File  |  1995-07-06  |  10KB  |  330 lines

  1. /*
  2.      File:        AppleGuide.h
  3.  
  4.      Contains:    Apple Guide Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __APPLEGUIDE__
  21. #define __APPLEGUIDE__
  22.  
  23.  
  24. #ifndef __APPLEEVENTS__
  25. #include <AppleEvents.h>
  26. #endif
  27. /*    #include <Errors.h>                                            */
  28. /*        #include <ConditionalMacros.h>                            */
  29. /*    #include <Types.h>                                            */
  30. /*    #include <Memory.h>                                            */
  31. /*        #include <MixedMode.h>                                    */
  32. /*    #include <OSUtils.h>                                        */
  33. /*    #include <Events.h>                                            */
  34. /*        #include <Quickdraw.h>                                    */
  35. /*            #include <QuickdrawText.h>                            */
  36. /*    #include <EPPC.h>                                            */
  37. /*        #include <AppleTalk.h>                                    */
  38. /*        #include <Files.h>                                        */
  39. /*            #include <Finder.h>                                    */
  40. /*        #include <PPCToolbox.h>                                    */
  41. /*        #include <Processes.h>                                    */
  42. /*    #include <Notification.h>                                    */
  43.  
  44. #ifndef __FILES__
  45. #include <Files.h>
  46. #endif
  47.  
  48. #ifndef __TYPES__
  49. #include <Types.h>
  50. #endif
  51.  
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55.  
  56. #if PRAGMA_ALIGN_SUPPORTED
  57. #pragma options align=mac68k
  58. #endif
  59.  
  60. #if PRAGMA_IMPORT_SUPPORTED
  61. #pragma import on
  62. #endif
  63.  
  64. typedef UInt32 AGRefNum;
  65.  
  66. typedef UInt32 AGCoachRefNum;
  67.  
  68. typedef UInt32 AGContextRefNum;
  69.  
  70. struct AGAppInfo {
  71.     AEEventID                        eventId;
  72.     long                            refCon;
  73.     void                            *contextObj;                /* private system field*/
  74. };
  75. typedef struct AGAppInfo AGAppInfo, *AGAppInfoPtr, **AGAppInfoHdl;
  76.  
  77. typedef pascal OSErr (*CoachReplyProcPtr)(Rect *pRect, Ptr name, long refCon);
  78. typedef pascal OSErr (*ContextReplyProcPtr)(Ptr pInputData, Size inputDataSize, Ptr *ppOutputData, Size *pOutputDataSize, AGAppInfoHdl hAppInfo);
  79.  
  80. #if GENERATINGCFM
  81. typedef UniversalProcPtr CoachReplyUPP;
  82. typedef UniversalProcPtr ContextReplyUPP;
  83. #else
  84. typedef CoachReplyProcPtr CoachReplyUPP;
  85. typedef ContextReplyProcPtr ContextReplyUPP;
  86. #endif
  87.  
  88. enum {
  89.     uppCoachReplyProcInfo = kPascalStackBased
  90.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  91.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Rect*)))
  92.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Ptr)))
  93.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))),
  94.     uppContextReplyProcInfo = kPascalStackBased
  95.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  96.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  97.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Size)))
  98.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Ptr*)))
  99.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(Size*)))
  100.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(AGAppInfoHdl)))
  101. };
  102.  
  103. #if GENERATINGCFM
  104. #define NewCoachReplyProc(userRoutine)        \
  105.         (CoachReplyUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppCoachReplyProcInfo, GetCurrentArchitecture())
  106. #define NewContextReplyProc(userRoutine)        \
  107.         (ContextReplyUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppContextReplyProcInfo, GetCurrentArchitecture())
  108. #else
  109. #define NewCoachReplyProc(userRoutine)        \
  110.         ((CoachReplyUPP) (userRoutine))
  111. #define NewContextReplyProc(userRoutine)        \
  112.         ((ContextReplyUPP) (userRoutine))
  113. #endif
  114.  
  115. #if GENERATINGCFM
  116. #define CallCoachReplyProc(userRoutine, pRect, name, refCon)        \
  117.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppCoachReplyProcInfo, (pRect), (name), (refCon))
  118. #define CallContextReplyProc(userRoutine, pInputData, inputDataSize, ppOutputData, pOutputDataSize, hAppInfo)        \
  119.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppContextReplyProcInfo, (pInputData), (inputDataSize), (ppOutputData), (pOutputDataSize), (hAppInfo))
  120. #else
  121. #define CallCoachReplyProc(userRoutine, pRect, name, refCon)        \
  122.         (*(userRoutine))((pRect), (name), (refCon))
  123. #define CallContextReplyProc(userRoutine, pInputData, inputDataSize, ppOutputData, pOutputDataSize, hAppInfo)        \
  124.         (*(userRoutine))((pInputData), (inputDataSize), (ppOutputData), (pOutputDataSize), (hAppInfo))
  125. #endif
  126.  
  127.  
  128. enum {
  129.     gestaltAppleGuidePresent    = 31,
  130.     gestaltAppleGuideIsDebug    = 30,
  131.     kAGDefault                    = 0,
  132.     kAGFrontDatabase            = 1,
  133.     kAGNoMixin                    = (-1)
  134. };
  135.  
  136. enum {
  137.     kAGViewFullHowdy            = 1,                            /* Full-size Howdy*/
  138.     kAGViewTopicAreas            = 2,                            /* Full-size Topic Areas*/
  139.     kAGViewIndex                = 3,                            /* Full-size Index Terms*/
  140.     kAGViewLookFor                = 4,                            /* Full-size Look-For (Search)*/
  141.     kAGViewSingleHowdy            = 5,                            /* Single-list-size Howdy*/
  142.     kAGViewSingleTopics            = 6                                /* Single-list-size Topics*/
  143. };
  144.  
  145. enum {
  146.     kAGFileMain                    = 'poco',
  147.     kAGFileMixin                = 'mixn'
  148. };
  149.  
  150. /* To test against AGGetAvailableDBTypes*/
  151. enum AGDBTypeBit {
  152.     kAGDBTypeBitAny                = 0x00000001,
  153.     kAGDBTypeBitHelp            = 0x00000002,
  154.     kAGDBTypeBitTutorial        = 0x00000004,
  155.     kAGDBTypeBitShortcuts        = 0x00000008,
  156.     kAGDBTypeBitAbout            = 0x00000010,
  157.     kAGDBTypeBitOther            = 0x00000080
  158. };
  159.  
  160. typedef UInt16 AGStatus;
  161.  
  162. /* Returned by AGGetStatus*/
  163.  
  164. enum {
  165.     kAGIsNotRunning,
  166.     kAGIsSleeping,
  167.     kAGIsActive
  168. };
  169.  
  170. typedef UInt16 AGWindowKind;
  171.  
  172. /* Returned by AGGetFrontWindowKind*/
  173.  
  174. enum {
  175.     kAGNoWindow,
  176.     kAGAccessWindow,
  177.     kAGPresentationWindow
  178. };
  179.  
  180. /* Error Codes*/
  181. /* Not an enum, because other OSErrs are valid.*/
  182. typedef SInt16 AGErr;
  183.  
  184. /* Apple Guide error codes*/
  185.  
  186. enum {
  187. /* -------------------- Apple event reply codes*/
  188.     kAGErrUnknownEvent            = -2900,
  189.     kAGErrCantStartup            = -2901,
  190.     kAGErrNoAccWin                = -2902,
  191.     kAGErrNoPreWin                = -2903,
  192.     kAGErrNoSequence            = -2904,
  193.     kAGErrNotOopsSequence        = -2905,
  194.     kAGErrReserved06            = -2906,
  195.     kAGErrNoPanel                = -2907,
  196.     kAGErrContentNotFound        = -2908,
  197.     kAGErrMissingString            = -2909,
  198.     kAGErrInfoNotAvail            = -2910,
  199.     kAGErrEventNotAvailable        = -2911,
  200.     kAGErrCannotMakeCoach        = -2912,
  201.     kAGErrSessionIDsNotMatch    = -2913,
  202.     kAGErrMissingDatabaseSpec    = -2914,
  203. /* -------------------- Coach's Chalkboard reply codes*/
  204.     kAGErrItemNotFound            = -2925,
  205.     kAGErrBalloonResourceNotFound = -2926,
  206.     kAGErrChalkResourceNotFound    = -2927,
  207.     kAGErrChdvResourceNotFound    = -2928,
  208.     kAGErrAlreadyShowing        = -2929,
  209.     kAGErrBalloonResourceSkip    = -2930,
  210.     kAGErrItemNotVisible        = -2931,
  211.     kAGErrReserved32            = -2932,
  212.     kAGErrNotFrontProcess        = -2933,
  213.     kAGErrMacroResourceNotFound    = -2934,
  214. /* -------------------- API reply codes*/
  215.     kAGErrAppleGuideNotAvailable = -2951,
  216.     kAGErrCannotInitCoach        = -2952,
  217.     kAGErrCannotInitContext        = -2953,
  218.     kAGErrCannotOpenAliasFile    = -2954,
  219.     kAGErrNoAliasResource        = -2955,
  220.     kAGErrDatabaseNotAvailable    = -2956,
  221.     kAGErrDatabaseNotOpen        = -2957,
  222.     kAGErrMissingAppInfoHdl        = -2958,
  223.     kAGErrMissingContextObject    = -2959,
  224.     kAGErrInvalidRefNum            = -2960,
  225.     kAGErrDatabaseOpen            = -2961,
  226.     kAGErrInsufficientMemory    = -2962
  227. };
  228.  
  229. /* Events*/
  230. /* Not an enum because we want to make assignments.*/
  231. typedef UInt32 AGEvent;
  232.  
  233. /* Handy events for AGGeneral.*/
  234.  
  235. enum {
  236. /* Panel actions (Require a presentation window).*/
  237.     kAGEventDoCoach                = 'doco',
  238.     kAGEventDoHuh                = 'dhuh',
  239.     kAGEventGoNext                = 'gonp',
  240.     kAGEventGoPrev                = 'gopp',
  241.     kAGEventHidePanel            = 'pahi',
  242.     kAGEventReturnBack            = 'gobk',
  243.     kAGEventShowPanel            = 'pash',
  244.     kAGEventTogglePanel            = 'patg'
  245. };
  246.  
  247. /* Functions*/
  248. /* AGClose*/
  249. /* Close the database associated with the AGRefNum.*/
  250. extern pascal AGErr AGClose(AGRefNum *refNum)
  251.  TWOWORDINLINE(0x7011, 0xAA6E);
  252. /* AGGeneral*/
  253. /* Cause various events to happen.*/
  254. extern pascal AGErr AGGeneral(AGRefNum refNum, AGEvent theEvent)
  255.  TWOWORDINLINE(0x700D, 0xAA6E);
  256. /* AGGetAvailableDBTypes*/
  257. /* Return the database types available for this application.*/
  258. extern pascal UInt32 AGGetAvailableDBTypes(void)
  259.  TWOWORDINLINE(0x7008, 0xAA6E);
  260. /* AGGetFrontWindowKind*/
  261. /* Return the kind of the front window.*/
  262. extern pascal AGWindowKind AGGetFrontWindowKind(AGRefNum refNum)
  263.  TWOWORDINLINE(0x700C, 0xAA6E);
  264. /* AGGetFSSpec*/
  265. /* Return the FSSpec for the AGRefNum.*/
  266. extern pascal AGErr AGGetFSSpec(AGRefNum refNum, FSSpec *fileSpec)
  267.  TWOWORDINLINE(0x700F, 0xAA6E);
  268. /* AGGetStatus*/
  269. /* Return the status of Apple Guide.*/
  270. extern pascal AGStatus AGGetStatus(void)
  271.  TWOWORDINLINE(0x7009, 0xAA6E);
  272. /* AGInstallCoachHandler*/
  273. /* Install a Coach object location query handler.*/
  274. extern pascal AGErr AGInstallCoachHandler(CoachReplyUPP coachReplyProc, long refCon, AGCoachRefNum *resultRefNum)
  275.  TWOWORDINLINE(0x7012, 0xAA6E);
  276. /* AGInstallContextHandler*/
  277. /* Install a context check query handler.*/
  278. extern pascal AGErr AGInstallContextHandler(ContextReplyUPP contextReplyProc, AEEventID eventID, long refCon, AGContextRefNum *resultRefNum)
  279.  TWOWORDINLINE(0x7013, 0xAA6E);
  280. /* AGIsDatabaseOpen*/
  281. /* Return true if the database associated with the AGRefNum is open.*/
  282. extern pascal Boolean AGIsDatabaseOpen(AGRefNum refNum)
  283.  TWOWORDINLINE(0x7006, 0xAA6E);
  284. /* AGOpen*/
  285. /* Open a guide database.*/
  286. extern pascal AGErr AGOpen(FSSpec *fileSpec, UInt32 flags, Handle mixinControl, AGRefNum *resultRefNum)
  287.  TWOWORDINLINE(0x7001, 0xAA6E);
  288. /* AGOpenWithSearch*/
  289. /* Open a guide database and preset a search string.*/
  290. extern pascal AGErr AGOpenWithSearch(FSSpec *fileSpec, UInt32 flags, Handle mixinControl, ConstStr255Param searchString, AGRefNum *resultRefNum)
  291.  TWOWORDINLINE(0x7002, 0xAA6E);
  292. /* AGOpenWithSequence*/
  293. /* Open a guide database and display a presentation window sequence.*/
  294. extern pascal AGErr AGOpenWithSequence(FSSpec *fileSpec, UInt32 flags, Handle mixinControl, short sequenceID, AGRefNum *resultRefNum)
  295.  TWOWORDINLINE(0x7004, 0xAA6E);
  296. /* AGOpenWithView*/
  297. /* Open a guide database and override the default view.*/
  298. extern pascal AGErr AGOpenWithView(FSSpec *fileSpec, UInt32 flags, Handle mixinControl, short viewNum, AGRefNum *resultRefNum)
  299.  TWOWORDINLINE(0x7005, 0xAA6E);
  300. /* AGQuit*/
  301. /* Make Apple Guide quit.*/
  302. extern pascal AGErr AGQuit(void)
  303.  TWOWORDINLINE(0x7010, 0xAA6E);
  304. /* AGRemoveCoachHandler*/
  305. /* Remove the Coach object location query handler.*/
  306. extern pascal AGErr AGRemoveCoachHandler(AGCoachRefNum *resultRefNum)
  307.  TWOWORDINLINE(0x7014, 0xAA6E);
  308. /* AGRemoveContextHandler*/
  309. /* Remove the context check query handler.*/
  310. extern pascal AGErr AGRemoveContextHandler(AGContextRefNum *resultRefNum)
  311.  TWOWORDINLINE(0x7015, 0xAA6E);
  312. /* AGStart*/
  313. /* Start up Apple Guide in the background.*/
  314. extern pascal AGErr AGStart(void)
  315.  TWOWORDINLINE(0x700A, 0xAA6E);
  316.  
  317. #if PRAGMA_IMPORT_SUPPORTED
  318. #pragma import off
  319. #endif
  320.  
  321. #if PRAGMA_ALIGN_SUPPORTED
  322. #pragma options align=reset
  323. #endif
  324.  
  325. #ifdef __cplusplus
  326. }
  327. #endif
  328.  
  329. #endif /* __APPLEGUIDE__ */
  330.